package com.link.base.base.policy.service;

import com.link.base.base.order.model.SaleOrder;
import com.link.base.base.policy.model.Policy;
import com.link.core.basic.service.BasicService;

/**
 * @author unknown
 * @date unknown
 * @comments 政策服务
 */
public interface PolicyService extends BasicService<Policy> {

    /**
     * 更新图片ID
     * @param entity
     * @throws Exception
     */
    public void imgIdUpdate(Policy entity) throws Exception;

    /**
     * <p>根据政策头id查询政策信息，并获取其下的范围，规则、条件、结果等信息，封装返回</p>
     *
     * @author yrf
     * @param entity
     * @return 政策
     * @throws Exception
     */
    public Policy getPolicyById(Policy entity) throws Exception;

    /**
     * <p>构建促销政策，包含政策、范围、规则、条件、结果等</p>
     *
     * @author yrf
     * @param entity
     * @throws Exception
     */
    public void insertPolicy(Policy entity) throws Exception;

    /**
     * <p>更新促销政策，包含政策、范围、规则、条件、结果等</p>
     *
     * @author yrf
     * @param entity
     * @throws Exception
     */
    public void updatePolicy(Policy entity) throws Exception;

    /**
     * 校验订单政策，返回应用了政策的订单信息
     * @auther HuangLJ
     * @param saleOrder
     * @return 订单
     * @throws Exception
     */
    public SaleOrder getPolicy(SaleOrder saleOrder) throws Exception;

    /**
     * 更新政策主要组织Id
     * @auther HuangLJ
     * @param policy 政策 ，必须有政策id ,主要组织id
     * @return 无
     * @throws Exception 常规
     */
    public void updatePolicyMainOrg(Policy policy) throws Exception;

}
